package com.pyb.java.commonutil.utils;

import java.util.Iterator;
import java.util.Map;

public class MapUtils {
    public static String getKeyByValue(Map map, Object value) {
        String keys="";
        Iterator it = map.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry = (Map.Entry) it.next();
            Object obj = entry.getValue();
            if (obj != null && obj.equals(value)) {
                keys=(String) entry.getKey();
            }
        }
        return keys;
    }
}
